<html><head><title>SetGadgetItemColor</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">SetGadgetItemColor()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#006666"><b>SetGadgetItemColor</b></font>(#Gadget, Item, ColorType, Color [, Column])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Changes a color attribute of the given gadget item. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
The gadget to use. 

</td></tr>
<tr><td><i>Item</i></td>
<td> 
The item to use. The first item in the gadget has index 0. 
If this parameter is set to -1, the color will be applied to the given 'Column' in all gadget items. 

</td></tr>
<tr><td><i>ColorType</i></td>
<td> 
The kind of color attribute to change. This can be one of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Gadget_FrontColor</font>     : Item text
  <font color="#924B72">#PB_Gadget_BackColor</font>      : Item background
</font></pre>

</td></tr>
<tr><td><i>Color</i></td>
<td> 
The new color for the attribute. <a href="../2ddrawing/rgb.html">RGB()</a> can be 
used to get a valid color value. To remove the custom color and go back to the default system color, set 
the 'Color' parameter to -1. 

</td></tr>
<tr><td><i>Column (optional)</i></td>
<td> 
The column to use for gadgets that support multiple columns. 
The first column has index 0. The default is column 0. 
If the this parameter is set to -1, the color will be applied to all columns of the given Item. 


</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>
None.


</blockquote><p><b>Remarks</b></p><blockquote>

This function is supported by the following gadgets: 
<br>
<br>
- <a href="listicongadget.html">ListIconGadget()</a> 
<br>
- <a href="treegadget.html">TreeGadget()</a> 


<br>
<br>
<b>Note:</b> With activated Windows XP style the color settings will probably be ignored 
or overwritten by the style. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 300, 300, "SetGadgetItemColor", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#006666">    ListIconGadget</font>(0, 10, 10, 280, 280, "Column 0", 100)
<font color="#006666">    AddGadgetColumn</font>(0, 1, "Column 1", 100)
    <b><font color="#006666">For</font></b> i = 1 <b><font color="#006666">To</font></b> 10
<font color="#006666">      AddGadgetItem</font>(0, -1, "Text 1"+<font color="#006666">Chr</font>(10)+"Text 2")
    <b><font color="#006666">Next</font></b>

<font color="#006666">    SetGadgetItemColor</font>(0, -1, <font color="#924B72">#PB_Gadget_FrontColor</font>, $0000FF,  1)
<font color="#006666">    SetGadgetItemColor</font>(0,  3, <font color="#924B72">#PB_Gadget_BackColor</font>,  $00FFFF, -1)
<font color="#006666">    SetGadgetItemColor</font>(0,  9, <font color="#924B72">#PB_Gadget_BackColor</font>,  $FFFF00,  1)
    <b><font color="#006666">Repeat</font></b>
    <b><font color="#006666">Until</font></b> <font color="#006666">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/setgadgetitemcolor.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="getgadgetitemcolor.html">GetGadgetItemColor()</a>, <a href="getgadgetcolor.html">GetGadgetColor()</a>, <a href="setgadgetcolor.html">SetGadgetColor()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=setgadgetitemattribute.html>SetGadgetItemAttribute()</a> - <a href=index.html>Gadget Index</a> - <a href=setgadgetitemdata.html>SetGadgetItemData()</a> ->

</body></html>